
#include "PreHeader.h"
#include "cGameScene.h"

#include "cGameLayer.h"
#include "cLogicDataManager.h"

bool cGameScene::init()
{
	bool bRet = false;
	do 
	{
		CC_BREAK_IF(!CCScene::init());

#if (CC_TARGET_PLATFORM == CC_PLATFORM_IOS)
#else
		CCFileUtils::setResourcePath("resource/");
#endif

		// load data
		sResult res = cLogicDataManager::it()->Load();
		if (res.code == eResultCode::FAIL)
		{
			CCMessageBox(res.desc.c_str(), "Data Load Error");
			break;
		}

		cGameLayer* layer = cGameLayer::node();
		CC_BREAK_IF(!layer);
		addChild(layer);

		bRet = true;
	} while (0);

	return bRet;
}